import openpyxl


class ReadeExcel:
    def __init__(self, file_path):
        self.file = openpyxl.load_workbook(file_path)
        self.sheet = self.file.active

    def readExcel(self):
        case_dict = {}
        cells_fist = self.sheet['A1:G1']
        for r in cells_fist[0]:
            case_dict[r.value] = ""
        cells = self.sheet['A2:G16']
        case_list = []
        for row in cells:
            for r, r_first in zip(row, cells_fist[0]):
                case_dict[r_first.value] = r.value
            case_list.append(case_dict)
        print(case_list)
        ...


if __name__ == '__main__':
    excel = ReadeExcel('搜索框.xlsx')
    excel.readExcel()
